From: Jasper St. Pierre Date: Wed, 8 Aug 2012 20:21:19 +0000 (-0300) Subject: workspacesView: Refactor thumb zooming out code X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~6053 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=efc128e68161bcc44297f021431fd6ead0876ada;p=gnome-shell.git workspacesView: Refactor thumb zooming out code https://bugzilla.gnome.org/show_bug.cgi?id=582650 --- diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 2b5eac5bc..b8204f04f 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -868,15 +868,10 @@ const WorkspacesDisplay = new Lang.Class({ let clipX = rtl ? x + controlsVisible : x; let clipY = y + (fullHeight - clipHeight) / 2; - if (this._zoomOut) { - width -= controlsNatural; - if (rtl) - x += controlsNatural; - } else { - width -= controlsVisible; - if (rtl) - x += controlsVisible; - } + let widthAdjust = this._zoomOut ? controlsNatural : controlsVisible; + width -= widthAdjust; + if (rtl) + x += widthAdjust; height = (fullHeight / fullWidth) * width; let difference = fullHeight - height;